package com.sy.common.service;

import com.sy.cloud.guess.model.Gokguessnum;
import com.sy.cloud.guess.model.Heroset;
import com.sy.cloud.guess.model.Orderbuffer;
import com.sy.cloud.wechat.model.Wxuser;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * Created by mac on 2017/11/22.
 */
@Slf4j
@Service
@Transactional(propagation= Propagation.REQUIRED, rollbackFor=Exception.class)
public class DbService implements IDbService {

    @Resource
    private IBaseService baseService;

    @Override
    public void updateUser(Wxuser wxuser) {
        baseService.update(wxuser);
    }

    @Override
    public List<Wxuser> getWxuserList(String hql){
        return baseService.listQuery(hql, Wxuser.class );
    }
    @Override
    public List<Heroset> getHeroList(String hql){
        return baseService.listQuery(hql, Heroset.class );
    }
    @Override
    public List<Heroset> getDigitsetList(String hql){
        return baseService.listQuery(hql, Heroset.class );
    }
    @Override
    public List<Orderbuffer> getOrderBufferList(String hql){
        log.info("dbService里面");
        return baseService.listQuery(hql, Orderbuffer.class );
    }

    @Override
    public List<Gokguessnum> getnumList(String hql){
        return baseService.listQuery(hql,Gokguessnum.class);
    }




}
